﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace SportManager
{
    static class Program
    {
        public static ExerciseFileKeeper ExercisesKeeper            = new ExerciseFileKeeper();
        public static TrainingsFileKeeper TrainingsKeeper           = new TrainingsFileKeeper();
        public static AntropometricalFileKeeper AntropometricKeeper = new AntropometricalFileKeeper();
        public static OptionsRegistryKeeper OptionsKeeper           = new OptionsRegistryKeeper();

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#if !DEBUG
            try
            {
#endif
                Application.Run(new MainForm());
#if !DEBUG
            }
            catch(Exception exeption)
            {
                System.Text.StringBuilder builder = new System.Text.StringBuilder();
                builder.AppendLine("Error message: " + exeption.Message);
                builder.AppendLine("Error source: " + exeption.Source);
                builder.AppendLine("Error data: " + exeption.Data.ToString());
                builder.AppendLine("Error target: " + exeption.TargetSite.ToString());
                MessageBox.Show(builder.ToString(), "Необработанная ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
#endif
        }
    }
}
